updating oE poke_string

poke_string

include machine.e 
namespace machine 
public function poke_string(atom buffaddr, integer buffsize, sequence s) 

Stores a C-style null-terminated ANSI string in memory

Parameters:
  1. buffaddr: an atom, the RAM address to to the string at.
  2. buffsize: an integer, the number of bytes available, starting from buffaddr.
  3. s : a sequence, the string to store at address buffaddr.
Comments:
  • This does not allocate an RAM. You must supply the preallocated area.
  • This can only be used on ANSI strings. It cannot be used for double-byte strings.
  • If s is not a string, nothing is stored and a zero is returned.
Returns:

An atom. If this is zero, then nothing was stored, otherwise it is the address of the first byte after the stored string.

Example 1:
 atom title 
 
title = allocate(1000) 
if poke_string(title, 1000, "The Wizard of Oz") then 
    -- successful 
else 
    -- failed 
end if 
See Also:

Using Strings, allocate, allocate_string

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu